package com.ruoyi.system.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysTsWorkOrderBiMapper;
import com.ruoyi.system.domain.SysTsWorkOrderBi;
import com.ruoyi.system.service.ISysTsWorkOrderBiService;

/**
 * SysTsWorkOrderBiService业务层处理
 * 
 * @author SYF
 * @date 2025-06-04
 */
@Service
public class SysTsWorkOrderBiServiceImpl implements ISysTsWorkOrderBiService 
{
    @Autowired
    private SysTsWorkOrderBiMapper sysTsWorkOrderBiMapper;

    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public SysTsWorkOrderBi selectSysTsWorkOrderBiByYear(String id) {
        return sysTsWorkOrderBiMapper.selectSysTsWorkOrderBiByYear(id);
    }

    /**
     * 查询SysTsWorkOrderBi列表
     * 
     * @param sysTsWorkOrderBi SysTsWorkOrderBi
     * @return SysTsWorkOrderBi
     */
    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public List<SysTsWorkOrderBi> selectSysTsWorkOrderBiList(SysTsWorkOrderBi sysTsWorkOrderBi)
    {
        return sysTsWorkOrderBiMapper.selectSysTsWorkOrderBiList(sysTsWorkOrderBi);
    }

    /**
     * 新增SysTsWorkOrderBi
     * 
     * @param sysTsWorkOrderBi SysTsWorkOrderBi
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public int insertSysTsWorkOrderBi(SysTsWorkOrderBi sysTsWorkOrderBi)
    {
        return sysTsWorkOrderBiMapper.insertSysTsWorkOrderBi(sysTsWorkOrderBi);
    }

    /**
     * 修改SysTsWorkOrderBi
     * 
     * @param sysTsWorkOrderBi SysTsWorkOrderBi
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public int updateSysTsWorkOrderBi(SysTsWorkOrderBi sysTsWorkOrderBi)
    {
        return sysTsWorkOrderBiMapper.updateSysTsWorkOrderBi(sysTsWorkOrderBi);
    }

    /**
     * 批量删除SysTsWorkOrderBi
     * 
     * @param years 需要删除的SysTsWorkOrderBi主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public int deleteSysTsWorkOrderBiByYears(String[] years)
    {
        return sysTsWorkOrderBiMapper.deleteSysTsWorkOrderBiByYears(years);
    }

    /**
     * 删除SysTsWorkOrderBi信息
     * 
     * @param year SysTsWorkOrderBi主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public int deleteSysTsWorkOrderBiByYear(String year)
    {
        return sysTsWorkOrderBiMapper.deleteSysTsWorkOrderBiByYear(year);
    }

    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public List<Map<String,Object>> selectKhtsOrder(){
        return sysTsWorkOrderBiMapper.selectKhtsOrder();
    }

    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public List<Map<String,Object>> selectKftsOrdersInfo(SysTsWorkOrderBi sysTsWorkOrderBi){
        return sysTsWorkOrderBiMapper.selectKftsOrdersInfo(sysTsWorkOrderBi);
    }
}
